package cn.net.ecode.modules.msg.task.impl;

import cn.net.ecode.common.config.Global;
import cn.net.ecode.common.service.BaseService;
import cn.net.ecode.modules.msg.entity.MessageRecord;
import cn.net.ecode.modules.msg.task.MsgSendService;

/**
 * 消息发送服务（微信实现）
 * @author ThinkGem
 * @version 2015-10-8
 */
public class WeixinSendService extends BaseService implements MsgSendService {
	
	public static String accessToken;
	
	@Override
	public boolean sendMessage(MessageRecord mr) {
		
		try {

			String appid = Global.getProperty("weixin.appid");
			String secret = Global.getProperty("weixin.secret");
			String serverToken = Global.getProperty("weixin.server.token");
			String servarAeskey = Global.getProperty("weixin.server.aeskey");
			
			if (accessToken == null){
				
			}
			
			logger.info("发送微信： " + mr.getReceiver() + "(" + mr.getReceiverName() + "), 内容：" + mr.getMessage().getContentText());
			
			return true;
		} catch (Exception ex) {
			logger.error("发送微信异常：", ex);
		}
		
		return false;
	}

}
